//index.js
Component({
	options: {
		multipleSlots: true // 在组件定义时的选项中启用多slot支持
	  },
	
	properties: {
		topShow: Boolean,
		boxList: Array,
		stule: Number,
		title: String,
		isshow: Boolean,
	},
	data: {
		list: []
	},

	attached(e) {
		console.log(this.data.boxList)
		let boxListDetail = this.properties.boxList
		boxListDetail.forEach(el => {
			el.jinri_fangwen = this.futerPeope(el.jinri_fangwen)
		})
		this.setData({
			list: boxListDetail
		})
	},
	methods: {
		futerPeope: function(numbers) {
			// console.log(numbers)
			return numbers > 10000 ? (numbers / 10000).toFixed(2) + '万' : numbers
		},
		// 更多点击事件
		liebiaoBtn: function() {
			tt.navigateTo({
				url: '../../pages/liebiao/liebiao?show=' + true + '&time=' + this.data.stule,
			})
		},
		ljcsDetail: function(e) {
			let item = e.currentTarget.dataset.item
			if (this.data.isshow) {
				tt.redirectTo({
					url: '../../pages/ljcs/ljcs?id=' + item.id,
				})
				return
			}
			tt.navigateTo({
				url: '../../pages/ljcs/ljcs?id=' + item.id,
			})
		}
	}
})
